/**
 *
 * Copyright 2012 TeleNav, Inc. All rights reserved.
 * SkyActivity.java
 * @author jwmeng (jwmeng@telenavsoftware.com)
 * @date 2012-10-17
 */
package com.telenav.module.user;

import android.app.Activity;
import android.app.Dialog;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.TextView;

import com.telenav.app.R;
import com.telenav.common.ui.CustomDialog;

public class FindUserActivity extends Activity {
	
	private TextView searchBTN;
	private TextView username;
	private Dialog myDialog;
	private AsyncTask<Void, Void, Void> mRegisterTask;
	
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.user_search);
        
        searchBTN = (TextView)this.findViewById(R.id.btn_find_user);
        username = (TextView)this.findViewById(R.id.find_username); 
        searchBTN.setOnClickListener(new OnClickListener()
        {
			@Override
			public void onClick(View arg0) 
			{
				findUser();
			}
        });
    }
    
    private void findUser()
    {
	       CustomDialog localMyProgressDialog = new CustomDialog(this);
	       myDialog = localMyProgressDialog;
           myDialog.show();
           Intent intent = new Intent(FindUserActivity.this, UserListActivity.class);
           intent.putExtra("searchKey", username.getText().toString());
           startActivity(intent);
           myDialog.cancel();
    }
    
    @Override
    protected void onDestroy() {
        super.onDestroy();
    }
}